﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PServiceBus.Core.Runtime {
    /// <summary>
    /// Class for handling messages received from a message handler
    /// </summary>
    /// <typeparam name="TMessage"></typeparam>
    public class MessageReceivedArgs<TMessage> : EventArgs where TMessage : class {
        private IList<TMessage> _messages;
        private DateTime _createDate;
        public MessageReceivedArgs(IList<TMessage> messages, DateTime createDate) {
            _messages = messages;
            _createDate = createDate;
        }
        /// <summary>
        /// Message received from underlying message handler
        /// </summary>
        public IList<TMessage> Messages { get { return _messages; } }
        /// <summary>
        /// Date the messages were generated
        /// </summary>
        public DateTime CreateDate { get { return _createDate; } }
    }
}
